<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
    <!-- <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'">
    <meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'"> -->
    <title>geojson transform</title>

    <style type="text/css">
      .file-result{
        padding: 20px 0;
      }
      .type-select{
        display: block;padding:20px 0;
      }
      select{
        padding: 5px 10px;font-size: 14px;
      }
    </style>

  </head>
  <body>
    <h3>选择任意geojson文件用于坐标系转换</h3>

    <div>
      <p>坐标系:</p>
      <p>'GCJ-02':Google Map、高德、腾讯使用</p>
      <p>'WGS-84':是国际标准，GPS坐标,天地图</p>
      <p>'BD-09':百度坐标偏移标准</p>
    </div>

    <div class="type-select">
      <select onChange="selectType(value);">
        <option value ="WGS-GCJ">国际转高德</option>
        <option value ="GCJ-WGS">高德转国际</option>
      </select>
    </div>

    <button onclick="openDialog()">选择文件</button>

    <div class="file-result" id="result-text">上传文件信息...</div>


    <script type="text/javascript">
      // 默认国际转高德
      let selectValue = 'WGS-GCJ'

      const selectType = (value) => {
        selectValue = value
      }
      const openDialog = async () => {
        /**
         * 通过window挂在的openFile事件对象执行通知
         * 选择文件后直接执行坐标转换并保存到本地
        */
        const _openDialog = await window.openFile.open(selectValue)
      }

    </script>
  </body>



  
</html>